import {reqCategoryList} from 'lianxi2/api/index'
const actions ={
    async getCategoryList(){
        let result =await reqCategoryList()
        if(result.code === 200){
            commit('SAVE_CATEGORY_LIST',result.data)
        }else{
            alert(result.message)
        }
    }
}

const mutations = {
    SAVE_CATEGORY_LIST(state,list) {
        state.categoryList= list
    }
}

const state = {
    categoryList:[]
}

export default ({
    actions,
    mutations,
    state
})